package com.jrx.anytxn.param.mapper.ext;

import com.jrx.anytxn.param.entity.TlPartnerGeneralLog;
import com.jrx.anytxn.param.mapper.base.TlPartnerGeneralLogMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ExtTlPartnerGeneralLogMapper extends TlPartnerGeneralLogMapper {

    /**
     * 按照产品ID，业务日期查询应分总金额
     * @param productId
     * @param tenantId
     * @param businessDate
     * @return
     */
    TlPartnerGeneralLog sumShareAmountByProductId(@Param("productId") String productId,
                                         @Param("tenantId") String tenantId,
                                         @Param("businessDate") Date businessDate);

    /**
     * 按照产品ID，时间段查询应分总金额
     * @param productId
     * @param tenantId
     * @param beginDate
     * @param endDate
     * @return
     */
    TlPartnerGeneralLog sumShareAmountByProIdAndBusiDate(@Param("productId") String productId,
                                                @Param("tenantId") String tenantId,
                                                @Param("beginDate") Date beginDate,
                                                @Param("endDate") Date endDate);


    /**
     * 保存
     * @param item
     * @return int
     */
    int insertbatch(List<TlPartnerGeneralLog> item);

    /**
     * 根据产品汇总查询
     * @param productId
     * @param tenantId
     * @return
     */
    TlPartnerGeneralLog selectTotalByProductId(@Param("productId") String productId,
                                               @Param("tenantId") String tenantId);

    TlPartnerGeneralLog selectByProductIdAndBusiDate(@Param("productId") String productId,
                                                  @Param("tenantId") String tenantId,
                                                  @Param("businessDate") Date businessDate);
}
